package com.ethink.order.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.PurchaseReturnOrderModeInfo;
import com.ethink.order.api.info.TocSaleImportLogDetailInfo;
import com.ethink.order.api.model.PurchaseReturnModel;
import com.ethink.order.api.request.PurchaseReturnOrderAddRequest;
import com.ethink.order.api.request.PurchaseReturnOrderUpdateRequest;
import com.ethink.order.api.request.PurchaseReturnPageModeQueryRequest;
import com.ethink.order.api.request.PurchaseReturnPageQueryRequest;
import com.ethink.order.api.response.PurchaseReturnDetailResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 采购退单 Facade接口
 *
 * @author default
 * @date 2022-12-06
 */
@FeignClient(name = "ethink-order-service", path = "order-service/facade/v1/purchaseReturnOrder", contextId = "purchaseReturnOrderFacade")
public interface PurchaseReturnOrderFacade {

    @PostMapping("add")
    @ResponseBody
    Long add(@RequestBody PurchaseReturnOrderAddRequest addRequest);

    @PostMapping("pageQuery")
    @ResponseBody
    Page<PurchaseReturnModel> pageQuery(@RequestBody PurchaseReturnPageQueryRequest request);

    @GetMapping("queryDetail")
    @ResponseBody
    PurchaseReturnDetailResponse queryDetail(@RequestParam("id") Long id);

    @GetMapping("delete")
    @ResponseBody
    Boolean delete(@RequestParam("id") Long id);

    @PostMapping("update")
    @ResponseBody
    Boolean update(@RequestBody PurchaseReturnOrderUpdateRequest updateRequest);

    @GetMapping("pass")
    @ResponseBody
    Boolean pass(@RequestParam("id") Long id);

    @GetMapping("refuse")
    @ResponseBody
    Boolean refuse(@RequestParam("id") Long id);

    @PostMapping("/querySaleOrderDetailOrderNoByOrderNo")
    @ResponseBody
    List<String> queryPurchaseReturnDetailOrderNosByOrderNos(@RequestBody List<String> orderNos);

    @PostMapping("/purchaseReturnPageModeQuery")
    @ResponseBody
    Page<PurchaseReturnOrderModeInfo> pageModeQuery(@RequestBody PurchaseReturnPageModeQueryRequest request);

}